"""
用户相关 URL 配置
包含认证、个人中心等功能路由
"""
from django.contrib import admin
from django.urls import path, include
from django.urls import path
from . import views
from .views import login_view, register_view, forgot_password_view, logout_view, send_verification_code, profile, \
    update_profile, privacy_settings, my_events, my_registrations, my_reviews, point_history, admin_dashboard, \
    admin_user_management, admin_event_management, admin_event_approval, admin_approve_event, admin_reject_event, \
    admin_delete_event, admin_toggle_user_status, admin_delete_user, view_event_details, delete_my_comment, \
    cancel_registration

app_name = 'customer'
urlpatterns = [

      #登录注册
    path('login/', login_view, name='login'),
    path('register/', register_view, name='register'),
    path('forgot-password/', forgot_password_view, name='forgot_password'),
    path('logout/', logout_view, name='logout'),
    path('send-verification-code/', send_verification_code, name='send_verification_code'),
    # 管理员页面
    # 管理员仪表板
    path('admin-dashboard/', views.admin_dashboard, name='admin_dashboard'),
    path('admin/dashboard-stats/', views.dashboard_stats, name='dashboard_stats'),
    # 管理员数据API
    path('admin/users-data/', admin_user_management, name='admin_users_data'),
    path('admin/events-data/', admin_event_management, name='admin_events_data'),
    path('admin/pending-events-data/', admin_event_approval, name='admin_pending_events_data'),
    # 数据统计相关路由
    path('admin/data-statistics/', views.admin_data_statistics, name='admin_data_statistics'),
    path('admin/system-settings/', views.admin_system_settings, name='admin_system_settings'),
    path('admin/update-settings/', views.admin_update_settings, name='admin_update_settings'),
    path('admin/clear-cache/', views.admin_clear_cache, name='admin_clear_cache'),
    path('admin/system-backup/', views.admin_system_backup, name='admin_system_backup'),
    # 管理员操作API
    path('admin/approve-event/<int:event_id>/', admin_approve_event, name='admin_approve_event'),
    path('admin/reject-event/<int:event_id>/', admin_reject_event, name='admin_reject_event'),
    path('admin/delete-event/<int:event_id>/', admin_delete_event, name='admin_delete_event'),
    path('admin/toggle-user/<int:user_id>/', admin_toggle_user_status, name='admin_toggle_user_status'),
    path('admin/delete-user/<int:user_id>/', admin_delete_user, name='admin_delete_user'),
    path('admin/view-event/<int:event_id>/', view_event_details, name='admin_view_event'),  #个人中心
    #个人中心
    path('profile/', profile, name='profile'),
    path('profile/update/', update_profile, name='update_profile'),
    path('profile/privacy/', privacy_settings, name='privacy_settings'),
    path('profile/my-events/', my_events, name='my_events'),
    path('profile/my-registrations/', my_registrations, name='my_registrations'),
    path('profile/my-reviews/', my_reviews, name='my_reviews'),
    path('profile/delete-comment/<int:comment_id>/', delete_my_comment, name='delete_my_comment'),
    path('profile/points/', point_history, name='point_history'),
    path('cancel-registration/', cancel_registration, name='cancel_registration'),
    # 草稿相关路由
    path('publish-draft/<int:draft_id>/', views.publish_draft, name='publish_draft'),
    path('delete-draft/<int:draft_id>/', views.delete_draft, name='delete_draft'),
# 积分管理相关路由
    # 积分管理独立页面
    path('admin/points/', views.points_management, name='admin_points_management'),
    path('admin/grant-points/<int:event_id>/', views.grant_points_for_event, name='grant_points_for_event'),
    path('admin/points/list/', views.points_list_data, name='points_list_data'),
    path('admin/points/user/<int:user_id>/', views.user_points_detail, name='user_points_detail'),
    path('admin/points/adjust/', views.adjust_user_points, name='adjust_user_points'),
    path('admin/points/batch-adjust/', views.batch_adjust_points, name='batch_adjust_points'),
    path('admin/points/statistics/', views.points_statistics, name='points_statistics'),
    path('admin/points/rules/', views.points_rules_management, name='points_rules_management'),
    path('admin/points/rules/update/<int:rule_id>/', views.update_points_rule, name='update_points_rule'),
    path('admin/points/export/', views.export_points_data, name='export_points_data'),
]